<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .parent {
      /* 父相 */
      position: relative;
      top: 0;
      left: 0;

      width: 200px;
      height: 200px;
      border: 1px solid black;
    }

    .child {
      /* 子绝 */
      position: absolute;
      top: 0;
      left: 50px;

      width: 100px;
      height: 100px;
      background-color: #17f;
    }
  </style>
</head>

<body>
  <!-- 子绝父相：设置子元素在父元素中的位置 -->
  <div class="parent">
    <div class="child"></div>
  </div>
</body>

</html>